package com.lanzhou.yuanfen.config;


import org.springframework.security.core.authority.SimpleGrantedAuthority;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 */
public class SystemConstant {

    /**
     * 获取 QQ 登录信息的 API 地址
     */
    public final static String USER_INFO_URI = "https://graph.qq.com/user/get_user_info";

    /**
     * 获取 QQ 用户信息的地址拼接
     */
    public final static String USER_INFO_API = "%s?access_token=%s&oauth_consumer_key=%s&openid=%s";

    public static final String CLIENT_ID = "101848364";

    /**
     * 默认授权用户权限: code
     */
    public static final List<SimpleGrantedAuthority> DEFAULT_GRANTED_AUTHORITY = new ArrayList<SimpleGrantedAuthority>() {{
        // 可以添加默认权限
        add(new SimpleGrantedAuthority("menu"));
        add(new SimpleGrantedAuthority("base"));
        add(new SimpleGrantedAuthority("authenticate"));
        // 填充用户页面
        add(new SimpleGrantedAuthority("fillInUser"));
        // 填充注册用户Post
        add(new SimpleGrantedAuthority("registerFillUser"));
        // 绑定已有用户Post
        add(new SimpleGrantedAuthority("bandingUser"));
    }};

    /**
     * 默认角色
     */
    public static final Long DEFAULT_ROLE = 2L;


}
